Updated permutateLexicographically sub module.