Added solution for Problem 4