the intersection function should be less dumb now