Converted from greedy-best-first to A*