Modified code to output for every file.