use itertools prod for cartesian product