Added reset logic and testing