Changed macros to write to output files. Also added two simple programs to check macros against first.