added reset method. some cleanup