Updated the optimal solution finder