reorganized objective function: success for example