script adjustment

Just a few tweaks to fix an issue.
re-org

move a few things around