rewrite curry