Since the filepath is forged above (line 50), I'd prefer if you keps two variables, `$fileName` and `$filepath`. `basename` is not necessary.