ported over some tests and cleaned up the code base a bit.
making sure I break it good.