finished store intersection function which updates the intersection, can
produce new ones, and merge same intersections