Solved all exercises form chapter 4