Got the ternary backwards