efficient multiset permutations