Cleaned code for the A* Search Algorithm