Updated sample code.