modified generation code to allow clustering T1, nonlinearity and thresholding T2