@Override
    public boolean undo(final CardGame game, final CardPanel panel) {
        List<Card> pack = game.getPack();
        if (game.canAddToDeckFromBoard()) {
            //We don't want to do this halfway through a deal
            if (pack != null) {
                Stack<Card> deck = game.getDeck();
                List<List<Card>> board = game.getBoard();
                System.out.println("Pack size:" + pack.size());
                //        if (deck.size() == 8 && board.get(0).size() == 7) {
                if (pack.size() == 0) {
                    //Special case where we deal 2 on the last one
                    pack.add(0, deck.pop());
                    pack.add(0, deck.pop());
                    System.out.println("Special undo");
                }// else if (deck.size() != 0 && deck.size() == board.get(0).size()) {
                else {
                    pack.add(0, deck.pop());
                }
                for (int i = 11; i >= 0; i--) {
                    List<Card> pile = board.get(i);
                    if (pile.size() > 0) {
                        pack.add(0, pile.remove(pile.size() - 1));
                    }
                }

                CardGame.repaintWhileDealing(panel);
                if (game.hasDealt()) {
                    new Thread() {
                        public void run() {
                            game.deal(panel);

                        }
                    }.start();

                }
                System.out.println("DECK UNDID: " + deck);
                System.out.println("PACK:" + pack);

            }
            System.out.println("===========================");
            return true;
        } else {
            return false;
        }
    }