Updated permutateLexicographically sub module