measuring the distance before planning