change Astar method & fix bugs