Finished ex2_3.cpp file