demo_app from chap 2