finish chap4 demo