rewrite cond