Add a explanation of reset/shift by pseudo-code.