New version of pathfinding, should be faster on large areas