added file number counting