functions union, intersect, and diff