Solved exercise 17, added new function to exercise 16 (Chapter 3)