updated final script