Added CalculateDistance.