updated hw0.cpp