switched to BETmask, made processing agnostic to mask type