Implemented the ifthenelse conversion.