Reimplemented ternary operator