updating both the scripts with latest changes