Added solution for Problem 6