normalizing of the pathfinding waypoints to remove ending diagonals