Added solution to exercise 3 in chapter 1