resetAll function created