Added distance function

Calculates distance between two points