removed non-working code (empty if(). Added reset()