work on ch.3 and ch.4
Merge branch 'chapt3'