added solution for exercise 5