Completed Problem 11 and improved algorithm for Problem 7