debugging

still have a bad ternary result.