modified example0.cpp