adding objective function