Write Tidy Data to CSV file

added code to write tidy data to a CSV file