Function mergeIntersecting