Update hw9 problem 2