LISTING 21.4 completed