generate a proper CSV file