Implement ternary operator