some work
refactoring and more
refactoring and more
compiles and test runs