private Node solveIteration(Node startNode, PriorityQueue<Node> minPQ) {
    for (Board board : startNode.board.neighbors()) {
      Node node = new Node(board, startNode.moves + 1, startNode);
      if (node.previousNode != null) {
        Node node1 = new Node(node);
        boolean addIn = true;
        while (node1.previousNode != null) {
          node1 = node1.previousNode;
          if (node1.board.equals(node.board)) {
            addIn = false;
            break;
          }
        }
        if (addIn) {
          minPQ.add(node);
        }
      }
    }
    return minPQ.remove();
  }