updated for batch processing