how about using itertools.product here?