added reset() function and the TODO's