update script to use batches