added comments
referenced wikipedia for the A* algorithim