Final HW4 solutions