function [xrabf,xrbcf,xracf,thetaf,vrabf,vrbcf,vracf,arab,arbc,arac,Ktot,tf]=eulerstep(xrabi,xrbci,xraci,theta,vrabi,vrbci,vraci,ti,dt,Frab,Frbc,Frac,mab,mbc,mac)

% EULER STEP
    arab = Frab/mab;
    arbc = Frbc/mbc;
    if (arab+arbc < 0)
        arac = -((arab.^2)+(arbc.^2)-2*arab*arbc*cos(theta)).^0.5;%(Frac(itcounter,:))/mac;
    else
        arac = ((arab.^2)+(arbc.^2)-2*arab*arbc*cos(theta)).^0.5;
    end
    

    Krab = 0.5*mab*vrabi.^2;
    Krbc = 0.5*mbc*vrbci.^2;
    Krac = 0.5*mac*vraci.^2;
    Ktot = Krab+Krbc;
    % energy not quite consistent with large oscilations.
%    Etot(itcounter,:) = Ktot(itcounter,:) + Vrint(itcounter,:);
        
    vrabf = vrabi + (arab*dt);
    vrbcf = vrbci + (arbc*dt);
    vracf = vraci + (arac*dt);

    xrabf = xrabi + (vrabf*dt);
    xrbcf = xrbci + (vrbcf*dt);
    xracf = xraci + (vracf*dt);

    tf = ti + dt;
    
    thetaf = theta;

