Attempt to integrate A* algorithm