WIP: completed implementation of batch_engine