Change to using object lookups rather than array lookups, makes intersection O(n+m) rather than O(n*m)