Gray Code improve