private void buildFreqsArray() {
		thetaWArr = new int[sg.getMaxSeqLength()];
		piArr = new double[sg.getMaxSeqLength()];
		int numGaps = 0;
		for(int i=0; i<thetaWArr.length; i++) {
			if ((!hasGap(i)) && isPolymorphic(i))
				thetaWArr[i] = 1;
			else
				thetaWArr[i] = 0;
		}
		
		for(int i=0; i<thetaWArr.length; i++) {
			if (!hasGap(i)) {
				double[] baseFreqs = getColumnBaseCounts(i);

				int count = 0;
				for(int j=0; j<baseFreqs.length; j++)
					count += baseFreqs[j];
				
				for(int j=0; j<baseFreqs.length; j++) {
					baseFreqs[j] = baseFreqs[j]/count * (baseFreqs[j]-1)/(count-1);
				}
				
				piArr[i] = 1.0-baseFreqs[0]-baseFreqs[1]-baseFreqs[2]-baseFreqs[3];
			}
			else {
				piArr[i] = 0;
				numGaps++;
			}
		}		
		
		freqs = piArr; //getValue() uses freqs.length to figure out how long to sequence is, so freqs must be assigned to 
					   //something, even though it's not used in the calculation. 
	}