Corrected how the horizontal_coordinate_distance is calculated