added documentation and examples