update sample.cpp