public double rank(Deck deck) {
//		long startTime = System.currentTimeMillis();
//		int count = 0;
		int wins = 0;
		int ties = 0;
		int losses = 0;
		for (int i = 0; i < deck.size(); ++i) {
			for (int j = i + 1; j < deck.size(); ++j) {
				for (int k = j + 1; k < deck.size(); ++k) {
					for (int l = k + 1; l < deck.size(); ++l) {
						Hand compHand = new Hand(deck.cardsAt(i, j, k, l));
						int result = compareTo(compHand);
						if (result > 0) {
							wins++;
						} else if (result < 0) {
							losses++;
						} else {
							ties++;
						}
					}
				}
			}
		}
		/*
        	  System.out.println(toString());
        	  System.out.println("wins: " + wins);
        	  System.out.println("ties: " + ties);
        	  System.out.println("losses: " + losses);
        	  System.out.println("total: " + (wins + ties + losses));
		 */
		//	    System.out.println("time: " + (System.currentTimeMillis() - startTime));
		//	    return wins - losses;
		return (double) wins / (wins + ties + losses);
	}