adding merging info and the merged graph