writing SampleCode