added code to write job/command files