function correct_t(filename)

load(filename);

index=0;
T=speed/50;

t2=zeros(size(t));
t2(1)=t(1);

t_add=0;

for i=2:length(t)
    
    if (t(i)<t(i-1))
        t_add=t2(i-1);
    end
    
    t2(i)=t(i)+t_add;
end

clear T index

update=2;
save(filename);