moved some data operations to update_data.R