changed findOptimum