add code for next permutation