adding back masking, though not tested yet