added documentation and example.