HW4: finish prob 1.