simplified cartesian product matching