Finished example 1 of chapter 5