add programs from chapter 2