sample code fixed