solutions to Exercise 2