Solved all exercises from chapter 3, except one.