Switched variable name to file_format
Changed conditions to a dictionary.