mainly new stat code for batch processing