changing ternary for boolean expression