Implemented lexicographic ordering of permutation group elements.