renamed files to readFiles to avoid confusion with the files array above