Add tests and updates up to listing 11.38
Fix issue with test from listing 11.38 and finish up to
Listing11.40