Added function to calculate distance between two coordinates