The qc function