revise minibatch procedure. see #38