added software hysteresis, now better response