changes to pathfinding, pseudocode