Added code for Reset function.