Unclear why os.path.join(infile) is needed here. Can you please explain?