updated A* pseudocode. almost done!