Changes for calculating distance.