Re-write parts of script