Complete Algo.optimize()