Added a solution for the CalculateDistance problem