Added code to write tidy data to a file.