min
added explicit 0 reset code
updated version