Solved some exercises from chapter 3