compute batches