matching the files based on name ordering