new algo to find lexicographic permutations.