sorting input files by name