rewrite head