private void doDistrDEEMaster(int numMutable, int strandMut[][],
			ParamSet sParams, String strandDefault[][],
			String minPEM, String maxPEM, double initEw, PrunedRotamers<Boolean> prunedRotAtRes,
			boolean doMinimize, RotamerSearch rs, String sfFile, String rotFile, boolean useSF, 
			int numSpPos, int typeDEE, boolean minimizeBB, boolean scaleInt, double maxIntScale, 
			boolean useEref, double eRef[][], boolean addWTRot){
		
		//the total number of residues (active site + ligand, if present)
		int totalNumRes = numMutable;
		/*if (ligPresent) //ligand is present
			totalNumRes++;*/
		
		// Generate all combinations
		int numMutRes = 1; //singles
		if (typeDEE==optPairs)
			numMutRes = 2; //pairs criterion
		int numComb = factorial(totalNumRes).divide(factorial(totalNumRes-numMutRes).multiply(factorial(numMutRes))).intValue();
		int residueMutatable[][] = new int[numComb][totalNumRes];
		generateCombinations(residueMutatable,totalNumRes,numMutRes);
		
		OneMutation mutArray[] = new OneMutation[numComb];
		for (int curMut=0; curMut<mutArray.length; curMut++){
			mutArray[curMut] = new OneMutation();
			mutArray[curMut].mutNum = curMut;
			mutArray[curMut].resMut = new int[totalNumRes];
			for (int curRes=0; curRes<totalNumRes; curRes++)
				mutArray[curMut].resMut[curRes] = residueMutatable[curMut][curRes];
		}
		
		boolean splitFlags[][][][][][] = null;
		splitFlags = rs.getSplitFlags(splitFlags);//get the current DE pairs
		outputObject(splitFlags,sfFile);
		int numberOfStrands = strandMut.length;
		String AAallowed[][] = new String[numberOfStrands][]; //the AA's to which each residue can mutate
		for(int str=0;str<numberOfStrands;str++){
			AAallowed[str] = new String[strandMut[str].length];
		}	
		for(int str=0;str<numberOfStrands;str++){
			for (int i=0; i<strandMut[str].length; i++)
				AAallowed[str][i] = (String)sParams.getValue("RESALLOWED"+str+"_"+i);
		}
		MutationManager mutMan = new MutationManager(null,mutArray,false);
		mutMan.setNumOfStrands(strandMut.length);
		mutMan.setStrandMut(strandMut);
		mutMan.setStrandDefault(strandDefault);
		//mutMan.setLigType(ligType);
		mutMan.setarpFilenameMin(minPEM);
		mutMan.setarpFilenameMax(maxPEM);
		mutMan.setParams(sParams);
		mutMan.setStericThresh(stericThresh);
		mutMan.setSoftStericThresh(softStericThresh);
		mutMan.setMutableSpots(numMutable);
		//mutMan.setnumLigRotamers(numLigRotamers);
		mutMan.setComputeEVEnergy(true);
		mutMan.setDoMinimization(doMinimize);
		mutMan.setMinimizeBB(minimizeBB);
		mutMan.setCalculateVolumes(false);
		mutMan.setInitEw(initEw);
		//mutMan.setLigPresent(ligPresent);
		mutMan.setUseSF(useSF);
		mutMan.setSpFlags(splitFlags);
		mutMan.setPrunedRot(prunedRotAtRes);
		mutMan.setSfFile(sfFile);
		mutMan.setRotFile(rotFile);
		mutMan.setDistrDACS(false);
		mutMan.setDistrDEE(true);
		mutMan.setAAallowed(AAallowed);
		mutMan.setNumSpPos(numSpPos);
		mutMan.setTypeDEE(typeDEE);
		mutMan.setDistDepDielect(distDepDielect);
		mutMan.setDielectConst(dielectConst);
		mutMan.setDoDihedE(doDihedE);
		mutMan.setDoSolvationE(doSolvationE);
		mutMan.setSolvScale(solvScale);
		mutMan.setVdwMult(softvdwMultiplier);
		mutMan.setScaleInt(scaleInt);
		mutMan.setMaxIntScale(maxIntScale);
		mutMan.setUseEref(useEref);
		mutMan.setEref(eRef);
		mutMan.setRotamerLibrary(EnvironmentVars.aaRotLib);

                mutMan.setDoPerturbations(rs.doPerturbations);
                mutMan.setPertFile(rs.pertFile);
                mutMan.setMinimizePerts(rs.minimizePerturbations);
                mutMan.setAddWTRot(addWTRot);
                mutMan.setIdealizeSC(Perturbation.idealizeSC);

		try{
			handleDoMPIMaster(mutMan,mutArray.length);
		}
		catch (Exception e){
			System.out.println("ERROR: "+e);
			System.exit(1);
		}
	}