added batches functionality.