So if I implemented this correctly, it seems to be picking sprites overlapping either Sprite1 or Sprite2, whereas I wanted to pick sprites that overlap both Sprite1 and Sprite2 simultaneously. While this picks the union of those sprites, I wanted to pick the intersection. Sorry if that wasn't clear.
EDIT:
Just to avoid further confusion, an example is this:
Sprite1 (corresponding to ID=foo1) overlaps Sprites 5 8 9 and 10
Sprite2 (corresponding to ID=foo2) overlaps Sprites 3 4 5 and 9
I want to pick sprites 5 and 9, as they are in both lists.