Updated the sample code