added Gray Code