function [jared, baller] = RK4(dxdt, span, init, int)

h = (span(2) - span(1))/int;
X = zeros(int+1, 1);
M = max(size(init));
Y = zeros(int+1, M);


x = init(1);
X(1) = x;
y = init(2);
Y(1,:) = y';

for i=1:steps
    
    k1 = dxdt(x, y);
    k2 = dxdt(x+0.5*h, y+0.5*k1*h);
    k3 = dxdt(x+0.5*h, y+0.5*k2*h);
    k4 = dxdt(x+h, y+k3*h);
    
    y = y + (1/6)*(k1 + 2*k2 + 2*k3 + k4)*h;
    
    x = x + h;
    
    X(i + 1) = x;
    Y(i+1, :) = y';
    
end

jared = X;
baller = Y;
    
    