set up first half of ternary