function [hic,time,t1,t2]=HICcalc(T,MA)

v = cumtrapz(T,MA); % Velocity added from time t(1)
 %plot(t,v)
 %hicmoje = (t(509)-t(120))*((v(509)-v(120))/(t(509)-t(120)))^2.5;
  
 n = length(MA);
 hic = -inf;
 for it = 1:n-1
  for jt = it+1:n
    if   (T(jt)-T(it))<0.015    
         h = (T(jt)-T(it))*((v(jt)-v(it))/(T(jt)-T(it)))^2.5;
   if h > hic
    hic = h;
    t1=T(it);
    t2=T(jt);
   end
    else
   end
  end
 end
 
 time=t2-t1;
 if time<(15/1000)
 else
     disp('Exceeded time 15 ms')
 end
end