end of chapter 6 implementation