- rewritten using ternary operator