Some more code done for exercise 11 from chapter 7.