Misc
lots of testing and refactoring!  :)