Here is the distance calculation