added sample.cpp with debug