private static int search5(Cards[] hands, Cards board, int numhands, int[] wins, int[] ties, Cards remaining) {
        int total = 0;
        for (int i = 0; i < remaining.size() - 4; i++) {
            Card card1 = remaining.get(i);
            board.add(card1);
            for (int j = i + 1; j < remaining.size() - 3; j++) {
                Card card2 = remaining.get(j);
                board.add(card2);
                for (int k = j + 1; k < remaining.size() - 2; k++) {
                    Card card3 = remaining.get(k);
                    board.add(card3);
                    for (int l = k + 1; l < remaining.size() - 1; l++) {
                        Card card4 = remaining.get(l);
                        board.add(card4);
                        for (int m = l + 1; m < remaining.size(); m++) {
                            Card card5 = remaining.get(m);
                            board.add(card5);
                            total = rankHands(hands, board, numhands, wins, ties, total);
                            board.remove(card5);
                        }
                        board.remove(card4);
                    }
                    board.remove(card3);
                }
                board.remove(card2);
            }
            board.remove(card1);
        }
        return total;
    }