added how to test the script and minor adjustments