more refactoring
CAPS globals
more refactoring
more refactoring; almost running again