changed cond to if