Started implementing
Finished refactoring
fixed unittests