public int evaluate(Card[] hand)   {
		long product = 1;
		for (int i = 0; i < 6; i++)  {
			int prime = FiveCardEvaluator.primes[hand[i].rank.ordinal()];
			product *= prime;
		}
    //System.out.println(ranks);

    int rank = ranks.get(product);
		
		// Look for flushes
		for (int i = 0; i < 4; i++) lengths[i] = 0;
		int flushSuit = -1;
		for (int i = 0; i < 6; i++) {
			Card card = hand[i];
			int suit = card.suit.ordinal();
			suitedHands[suit][lengths[suit]] = card;
			lengths[suit]++;
			if(lengths[suit] > 4) flushSuit = suit;
		}
		
		// No flushes found
		if(flushSuit == -1) return rank;
		
		// Flushes found
		int flushRank = Integer.MAX_VALUE;
		if(lengths[flushSuit] == 5){
			flushRank = fiveCardEvaluator.evaluate(suitedHands[flushSuit]);
			return Math.min(rank, flushRank);
		}
		
		// 6 card flush found
		for (int[] c56 : choose5From6) {
			flushRank = fiveCardEvaluator.evaluate(hand[c56[0]],hand[c56[1]],hand[c56[2]],hand[c56[3]],hand[c56[4]]);
			rank = Math.min(rank, flushRank);	
		}
		return rank;
	}