adjusting the script for scripted use
Merge pull request #368 from KurtStam/master

adjusting the script for scripted use