Added solution to Problem 5.