[Ifeffit] minimize function