rewrote csv_writer