Updating the sample code