added global optimization routine