Added solution for exercises 6 of chapter 3.