A* Pathfinding in Python with Manhattan Heuristic