function ydot = kepler_ode(t,ms1,ms2,y)
 
%obtain ‘r’ and ‘v’ from ‘y’ 
r = [y(1);y(2);y(5);y(6)];
v = [y(3);y(4);y(7);y(8)];
 
% use the following three variables from the main worksheet
% must declare them 'global' here and there
global G

R12 = [r(1)-r(3);r(2)-r(4)];
R21 = [r(3)-r(1);r(4)-r(2)];
 
% Now put your formula for the force and acceleration here
F12 = (-(G*ms1*ms2)./((norm(R12))^3)).*R12;
F21 = (-(G*ms1*ms2)./((norm(R21))^3)).*R21;

F = [F12;-1.*F12];
a = [[F(1);F(2)]./ms1;[F(3);F(4)]./ms2];
 
% set the column ‘ydot’ that will be returned to the calling routine
ydot = [v(1);v(2);a(1);a(2);v(3);v(4);a(3);a(4)];
return