Implemented sample code.