Rewrite of script