hw4 p1 and p3