move gray so as to not introduce further misordering