revise pathfinder implementation