Finessing of the script and dud code removal