Added save to csv file functionality