Added reset logic. Still reseting functionality left