Changing multiradix gray code to use the glue and local structure.