add docstring and rename to reset_output
add unit test for reset_output