Merging referal diagram