updated ternary statement