Solved exercise 7