refactor, lots of changes pt 2.

Fixes #8