Added calcluate distance method

Check this out for me then merge.