Started rewrite of script.