added documentation and sample