added tracking of arbitrary objective functions to keep optimum