edited threshEst and constStimLOOP