adds distance method
[Closes #2]