Ternary operator in action

placed actual conditions and actions