added solution for exercise 8