Move variable creation
Rearrange order so that files are last in command string