changed lab4.cpp