refactoring a few of the globals
a couple of bugs squished; refactored a little