changed generateCSV