added reset function for debugging