solve exercise 3