Replaced the astar algorithm with python-pathfinding as was very slow.
Not integrated into code yet.