some improvements to pathfinding