demo application of chapter 2