Trying to use A* search algorithm.