Programs from chapter 9