CSV file generation working