changed write.table to write, and modified the input for writing. need to use df_to_dat() to convert matrix into long character string