finished ordered_permutations