printing functions and fixing astar bug