Added function for distance calculation between 2 points