refine the astar to fix the bug of cost function, and use manhattan distance as the heuristic function