public char getConsensusBase(int site, boolean useAmbiguities) {
		double[] freqs = getColumnBaseFreqs(site);
		char[] bases = {'A', 'C', 'T', 'G'};
		for(int i=0; i<freqs.length; i++) { //Sort by frequency, but sort bases at the same time
			for(int j=i; j<freqs.length; j++) {
				if (freqs[i]<freqs[j]) {
					double tmpF = freqs[i];
					char tmpC = bases[i];
					freqs[i] = freqs[j];
					bases[i] = bases[j];
					freqs[j] = tmpF;
					bases[j] = tmpC;
				}
			}
		}
		
		if (!useAmbiguities)
			return bases[0]; //This is the most frequent base
		else {
			if (Math.abs(freqs[0]-freqs[1])<1e-6) {
				if (Math.abs(freqs[1]-freqs[2])<1e-6) {
					if (Math.abs(freqs[2]-freqs[3])<1e-6) { //They're all the same
						return 'N';
					}
					else {
						char c = getAmbiguityCode(bases[0], bases[1], bases[2]);
						System.out.println("Code for " + bases[0] + ", " + bases[1] + ", " + bases[2] + " is " + c);
						return c;
					}
				}
				else	{
					char c = getAmbiguityCode(bases[0], bases[1]); 
					System.out.println("Code for " + bases[0] + ", " + bases[1] + " is " + c);
					return c;
				}
			}
			else 
				return bases[0];
		}
	}