multiple batches now get merged into the results hash; some refactoring of do_operation