update sample code