Added generic code to get union intersection and compliment of seq of events