Hysteresis now working