now iteration n has access to obj_val for iteration n instead of n-1