Defined sequence of batches algorithm