move print iteration header to func