solve exercise 2.57
solve exercise 2.58 a
solve exercise 2.58 b