Moved pathfinding into a seperate thread