solution of exercise 1-16
solution of exercise 1-17