Finds the distance