Solution for the exercise 2 added.