moved/improves QC.java