user ternary operator instead of if command