HW4 Solution