gray code reimpl