Added script execution and branch checking