Added solution to exercise 6