added snail sort next permutation