Do exercises 5.2--5.5
Merge pull request #324 from JasonGross/ex-ch-5

Do exercises 5.2--5.5