Implemented A* Search.