modify runBatch
modify to have several outputs