implemented reset function