AMDified script

Just in case you are running the defacto github version of this script I thought I would submit a PR to you for this AMDified version I created.