Added Code Listing 5.7; continuation of 5.6