Added solution to Problem 6