fixed a conditional operator and semantics