Added code to write tidy data to disk