commenting and simplification of the reset
merged master and more commenting