Optimized problem 10 moar for good measure.