refactor
added example. fixed tests.