Added a procedural gray code generator