refactored to proper object, added unit tests
fixed unit tests -- still in progress