sample code updated