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

adjusting the script for scripted use