n9 rewrite