Updated example4.cpp to be put in