- get the distance in the right order