testing the cartesian product