ternary operator exercise