       	//float dist =  abs(length(norm, vec2(0.0))-0.5) ;
       	//float dist = abs(k_y) /(length_val+kernel_val*2.);        
      	
-     	
-     	vec2 interval = intesect(vec2(k_x-1., k_x+1.), vec2(-length_val/2., length_val/2.));     	
+     	// evaluate if the kernel is bigger then the line and 
+     	vec2 interval = intersect(vec2(k_x-1., k_x+1.), vec2(-length_val/2., length_val/2.));     	
      		
      	float v = abs(interval[1] - interval[0])/2. ;
      	

  		 
  		kernel_val = kernel;
  		length_val = abs(lengths) / kernel_val;
  		k_x = dir * (length_val/2.+ 1.);
  		k_y = edge ;	
  		
  		
  		gl_Position = p;   
  	
  		
  		
		
      }
    </script>
    

  	 varying float k_y;
  
  
  	 
   	 float length(vec2 a, vec2 b){
        	return sqrt(pow((abs(a[0]-b[0])),2.)+pow((abs(a[1]-b[1])),2.));
      	}
      	
     vec2 intersect(vec2 a, vec2 b){
     	vec2 res = vec2(0.,0.);   
        if ( (a[0] >= b[0]) && (a[1] <= b[1]) ){
     		res = a;
