public boolean evaluateNextStep() {

        Node n = open.poll();

        if (n == null) {
//            System.out.println("");
//            System.out.println("Couldn't reach goal!");
//            System.out.println("");
            return true;
        }
        if (n.equals(goalNode)) {
//            System.out.println("");
//            System.out.println("Goal reached!");
//            System.out.println("");
            return true;
        }

        closed.add(n);
        n.setColor(Color.GREEN);

        for (Node neighbour : n.getNeighbours()) {

            if (!neighbour.isWalkable()) {
                continue;
            }

            float cost = n.getG() + n.getCostTo(neighbour);

            if (open.contains(neighbour) && cost < neighbour.getG()) {
                open.remove(neighbour);
                neighbour.setColor(Color.GREY);
            }
//            /*
//             * This should never happen if you have an monotone admissible heuristic.
//             * However in games we often have inadmissible heuristics.
//             */
//            if (closed.contains(neighbour) && cost < neighbour.getG()) {
//                System.out.println("Removing from Closed");
//                closed.remove(neighbour);
//            }



            if (!closed.contains(neighbour) && !open.contains(neighbour)) {
                neighbour.setG(cost);
                open.add(neighbour);
                neighbour.setColor(Color.BLUE);
                neighbour.setParent(n);
            }

        }

        return false;
    }