rename some variables in pathfinding algo for clarity