added tests and examples, updated docs