Made pathfinding more efficient by removing the regeneration each time