source code for A* Algorithm assignment