Solve exercise 3