finished example 7.2.3