misc modifications to get script to run, ran successfully