more work on pathfinding