Listing 7.16 modifications