begin hw3 probs 3 and 4