Move list of directories to a local variable and create the fn variable to use for an individual file name rather than using path.