Improved mine comparing and streamlined pathfinding heuristic.