Change cond to an if