added reset() function