first half of ternary