Update SampleCode.cpp

The recent change needs more work