really fleshed out the pathfinding code.