A* improved
Comments are added and A* improved.