same method now used for all pathfinding