Solve Exercises for chapter 6