rough rewrite