Re-posting of exercise 2 chapter 9