Add function to save to csv