complete rewrite, much more structured, moving toward encapsulation