i pulled this line out into a method called save_data for extremely readable code.