working on exercises of chap5