Completed Problem 11

Not exactly the most elegant solution, but it works.