Added explanation of my optimal solution.