finish gray code