add ex1 to ex3 from chapter3