hw3 p1 and p3