trying to fix bugs in A*