updating the code to output batches
new dir