generates CSV file
method that creates csv file