ternary function changed to BM2 form