adding tests.  fleshed out basic structure.  bug fixing now.
first working version.