rewrite (cont)