use product instead of permutations