transition from array order to mask