exercise 2.5a+b