code to make testing easier

shell script is for automated testing, changes to main code also to
allow for automated test