Pathfinding optimization #2

minimizes data initialization.