pathfinding updated

rewrote pathfinding