Update HW8 problem 3