how to rewrite ai