Updated SampleCode