Added permutateLexicographically procedure.