finishing up with minibatches implementation