Added documentation and sample code.