added ability to save as csv file