Add getDistance() function to utilities