Completed exercises 1.21 and 1.22.