added some data cleaning to the make_script method