Updated system for calculating distance and coordinates