Added A* algorithm.