Added minimization algorithm