Optimizing Problem 3