added genCSV()