upgraded script_SA