fixed calculation direction to closest place