First code sample from fourth chapter, tested.