function [YNew,counter,residual] = IMPLICIT(y,h,tolerance) 
error = 5;

%% Explicit Predictor

y_k = y;

%% Implicit Corrector Step
counter = 0;
while error >=tolerance
    y_2 = y + (h.*fun(y_k));
    if counter == 0
        residual = norm(y_2-y_k);
    end
    error_vector = abs(y_2-y_k);
    error = norm(error_vector);
    y_k = y_2;
    counter = counter+1;
end

YNew = y_2;
    
  