add examples, tests, change class interface (fix typo)