Added a reset function.