changed to process batches from oldest to newest