finished distance function definitions