I would prefer to use the original pattern (a new variable) instead of assigning back to the `dir` argument. The change would therefore involve switching references to `dir` into references to `directory`.