Changed sample.cpp