Add next_permutation