Update assignment2.cpp