fixed typo causing no commands to be written, changed to write to a separate script file #11