write sample code