Added solution for exercise 24.