updated to streamline batch processing