Bunch of Astar code.