refactor and work towards 0.0.2
tests passing
fixing conflicts from previous refactor attempt