A* implemented in python