improvements to documentation and sample code