public Iterable<Board> solution() {
        if (!isSolvable())
            return null;
        Stack<Board> solution = new Stack<Board>();
        solution.push(solutionNode.board);
        SearchNode n = solutionNode;
        while (n.prevSearchNode != null) {
            solution.push(n.prevSearchNode.board);
            n = n.prevSearchNode;
        }
        return solution;
    }