added sample.cpp