Exercises done for chapter 4