finish most of chap2
fix some problems in chap1
add (mostly complete) chap3