State monad finally is crystal clear for me