function [k_T]=konec_T(SWCpt,x,org,p_T,tep,fvz)
 
k_T=[];
for i=1:3
org(i,:)=org(i,:)+abs(min(org(i,:)))+1;
end
    
for i=1 : length(p_T)  
  pom=[];
   for j=1:3
       k=30;
       while p_T(i)+k+5<length (org)&&(abs((org(j,p_T(i)+k+5))-(org(j,p_T(i)+k))))>5
            k=k+1;
       end
       pom(j)= p_T(i)+k;
   end    
       
   k_T=[k_T max(pom)];
   
end




