function [change_step,t,y] = adamsmoult6_step(ode_fxns,y,t,h)
t_temp = t;
y_temp = y;
i = 1;

change_step = 0;
while (change_step == 0)
         y_check = y_temp(:,7)+ h/1440*(4277*ode_fxns(t_temp(6),y_temp(:,6))...
          -7923*ode_fxns(t_temp(5),y_temp(:,5))+9982*ode_fxns(t_temp(4),y_temp(:,4))...
          -7298*ode_fxns(t_temp(3),y_temp(:,3))+2877*ode_fxns(t_temp(2),y_temp(:,2))...
          -475*ode_fxns(t_temp(1),y_temp(:,1)));
          check = 1; 
          y_old = y_check;
          while (check > 10^-3)
            y_check = y_temp(:,6)+ h/1440*(475*ode_fxns(t_temp(6)+h,y_old(:))+1427*...
                ode_fxns(t_temp(6),y_temp(:,6))-798*ode_fxns(t_temp(5),y_temp(:,5))...
                +482*ode_fxns(t_temp(4),y_temp(:,4))-173*ode_fxns(t_temp(3),y_temp(:,3))...
                +27*ode_fxns(t_temp(2),y_temp(:,2)));
            check = max(abs(y_old(3:4)-y_check(3:4)));
            if (check > 10^-2)
                change_step = 1;
                break
            elseif(check < 10^-4)
                change_step = 2;
                break
            else
            y(:,6+i+1) = y_check;
            y_old = y(:,6+i+1);
            y_temp(:,1:6) = y_temp(:,2:7); t_temp(1:5)= t_temp(2:6);
            y_temp(:,7) = y(:,6+i+1); t_temp(6) = t_temp(6) + h;
            i = i+1;
            end
          end
          
    
end
        
end

