changed code to reflect count instead of filenames