Added batchSize variable so changes in the batch size only requires one change