Solved chapter 12 exercises