Integrated changes from old writing branch

Picked changes for chapters 02 and 04