started batching code