Added reset function.