Finish exercises 6.5.1 to 6.5.3.