Adding the ex3 from the chapter 1