updated script: