updated documentation with sample code