Converts boolean expression into an if statement