Solved the first half of the exercise 1.11.