Updated sample code