Solve exercise 2