working but very slowly
trying filtering through intersections
corrected union/intersection