solution of exercise 1-12
solution of exercise 1-13