updated test.cpp file for demo