Changed to use fileCount rather than fileCounter