I'm trying to implement A* path finding algorithm (now it's Dijkstra's algorithm i.e without heuristic) using this article http://www.policyalmanac.org/games/aStarTutorial.htmLink. But I can't figure out what's wrong in my code (it finds incorrect path).