Adding solution for exercise 6.