Added solution for exercise 2 in chapter 1