modify sample code.