changed sample code