Update next-permutation