A* now working properly