solve exercise 3.1