public PrunedRotamers<Boolean> DoPruneStericTemplate(int numMutable, int strandMut[][],
			PrunedRotamers<Boolean> prunedRotAtRes, double stericE){
		
		eliminatedRotAtRes = prunedRotAtRes;
		
		if (prunedIsSteric==null){ //no pruning runs done yet
			prunedIsSteric = new PrunedRotamers<Boolean>(numMutable,strandMut, this, false);//boolean[prunedRotAtRes.length];
			//for (int i=0; i<prunedIsSteric.length; i++)
			//	prunedIsSteric[i] = false;
		}
		int numAAtypes[] = new int[numMutable];
		
		int ctr=0;
		for(int str=0;str<strandMut.length;str++){ //the number of AAs allowed for each AS residue
			for(int i=0;i<strandMut[str].length;i++){
				numAAtypes[ctr] = strandRot[str].getNumAllowable(strandMut[str][i]);
				ctr++;
			}
		}
		//int numAAtypes[] = new int[numMutable];
		//for (int i=0; i<numAAtypes.length; i++) //the number of AAs allowed for each AS residue
		//	numAAtypes[i] = sysLR.getNumAllowable(residueMap[i]);
		
		int numPruned = 0;
		
		//Compute for the AS residues first
		for (int curPos=0; curPos<numMutable; curPos++){
			int str=mutRes2Strand[curPos];
			int strResNum=strandMut[str][mutRes2StrandMutIndex[curPos]];
			for (int AA=0; AA<numAAtypes[curPos]; AA++){
				int curAA = strandRot[str].getIndexOfNthAllowable(strResNum,AA);
				
				//find how many rotamers are allowed for the current AA type at the given residue;
				//note that ala and gly have 0 possible rotamers
				int numRotForCurAAatPos = getNumRot( str, strResNum, curAA );
				
				for(int curRot=0; curRot<numRotForCurAAatPos; curRot++){
					try{
					if ( arpMatrix.getIntraAndShellE(curPos, curAA, curRot) >= stericE ){
						
						//int index_r = curPos*totalNumRotamers + rotamerIndexOffset[curAA] + curRot;
						
						eliminatedRotAtRes.set(curPos,curAA,curRot, true);
						
						prunedIsSteric.set(curPos, curAA, curRot, true);
						numPruned++;
					}
				}
					catch(Exception e){
						System.out.println(curPos + " "+ curAA+" "+curRot);
			}
		}
			}
		}
		
		//If there is a ligand, compute for the lig rotamers as well
		/*if (numLigRotamers!=0){
			for (int curRot=0; curRot<numLigRotamers; curRot++){
				
				int ligAAind = ligROT.getIndexOfNthAllowable(0,0);
				
				if ((arpMatrix[numInAS][ligAAind][curRot][numInAS][0][0]+arpMatrix[numInAS][ligAAind][curRot][numInAS][0][1])>=stericE){
					
					int index_r = numInAS*totalNumRotamers+curRot;
					
					eliminatedRotAtRes[index_r] = true;
					
					prunedIsSteric[index_r] = true;
					numPruned++;
				}
			}
		}*/
		
		System.out.println("Number of rotamers pruned due to incompatibility with the template: "+numPruned);		
		
		return eliminatedRotAtRes;
	}