apparently need to calculate cartesian product manually