Added more documentation and sample code