updating objective function