Updated .cpp file