Add sum, set, union, and intersection functions