Corrected loop for NumFiles