pathfinding is functional, terribly naive