fixes for getting script working and printing correctly.

here are some minor changes.  comments below