Added solution to Problem 4