Added most of Peter's exercise 3.8 code to code-hw4.R