Added a reset function