changed write.table to write.csv in order to use the append setting