how to rewrite your script