added global optimization