Script now writes tidy dataset out to file