changed surrogate gap and dual residual calculation