changed stochastic to batch