Total distance is calculated correctly