added batch processing