added a reset function