added documentation and an example