Latest working version to detect all filenames