4/2/14 - add new hysteresis function, and updated scripts