Re-posting of exercise 4 chapter 9