hw2 ex3 & ex4