Rewrite script.