updating sample code