merge_data func work in progress