solved some exercises from chapter 3