Add proc to write files
bug fixes
Review changes
Merge pull request #11 from qcode-software/file_write

Add proc to write files