executeMePlease = "";
for (mi=1; mi<rateClassCount; mi=mi+1)
{
	executeMePlease = executeMePlease + "global shapeParameterPS_" + mi + " = 1/" +  
					  ((rateClassCount+1)-mi) + ";\nshapeParameterPS_" + mi + ":<1;\n";
}

executeMePlease = executeMePlease + "\nglobal shapeParameterRS_1=.3;shapeParameterRS_1:<1;";

for (mi=3; mi<=rateClassCount; mi=mi+1)
{
	executeMePlease = executeMePlease + "global shapeParameterRS_" + mi + " = 1.5;" + "\nshapeParameterRS_" + mi + ":>1;\n";
} 

rateStrMx    = {rateClassCount,1};
rateStrMx[0] = "shapeParameterRS_1";
rateStrMx[1] = "1";

for (mi=3; mi<=rateClassCount; mi=mi+1)
{
	rateStrMx[mi-1] = rateStrMx[mi-2]+"*shapeParameterRS_"+mi;
} 	

freqStrMx    = {rateClassCount,1};
freqStrMx[0] = "shapeParameterPS_1";

for (mi=1; mi<rateClassCount-1; mi=mi+1)
{
	freqStrMx[mi] = "";
	for (mi2=1;mi2<=mi;mi2=mi2+1)
	{
		freqStrMx[mi] = freqStrMx[mi]+"(1-shapeParameterPS_"+mi2+")";		
	}
	freqStrMx[mi] = freqStrMx[mi]+"shapeParameterPS_"+(mi+1);	
}	

freqStrMx[mi] = "";
for (mi2=1;mi2<mi;mi2=mi2+1)
{
	freqStrMx[mi] = freqStrMx[mi]+"(1-shapeParameterPS_"+mi2+")";		
}
freqStrMx[mi] = freqStrMx[mi]+"(1-shapeParameterPS_"+mi+")";	

executeMePlease = executeMePlease + "\n\nglobal shapeParameterScale:="+rateStrMx[0]+"*"+freqStrMx[0];

for (mi=1; mi<rateClassCount; mi=mi+1)
{
	executeMePlease = executeMePlease + "+" + rateStrMx[mi] + "*" + freqStrMx[mi];
}


executeMePlease = executeMePlease + ";\nshapeParameterCFM={{" + freqStrMx[0];

for (mi=1; mi<rateClassCount; mi=mi+1)
{
	executeMePlease = executeMePlease + "," + freqStrMx[mi];
}

executeMePlease = executeMePlease + "}};\nshapeParameterCRM={{" + rateStrMx[0] + "/shapeParameterScale";

for (mi=1; mi<rateClassCount; mi=mi+1)
{
	executeMePlease = executeMePlease +  "," + rateStrMx[mi] + "/shapeParameterScale";
}

executeMePlease = executeMePlease + "}};\n\ncategory categoryPlaceholder   = (" + rateClassCount + ", shapeParameterCFM , MEAN, ,shapeParameterCRM, 0, 1e25);\n\n";
ExecuteCommands (executeMePlease);
executeMePlease = "";
