remove legacy code and add doctests

removing all previous legacy code and failing tests

add doctests for example implementation before writing unit tests