clean up / fixes

more cleanup / minor mods to code