Completed exercises 3.16, 3.17, 3.18, 3.19