anchor.diff:  }
   ----
   
  -This is pretty much all the logic we need. The rest of the code simply renders state every frame:
  -
  -
  -[source,javascript]
  -----
  -function render(field, canvas, particles) {
  +This is pretty much all the logic we need. The rendering function looks like this:
  +
  +
  +[source,javascript]
  +----
  +function render(field, canvas, particles, stopping_fraction) {
   	var i = particles.count;
   	while (i--) {
       	var index = (particles.y[i] * field.width + particles.x[i]) * 4;
  -    	var isStuck = particles.stuck[i];
  -    	canvas[index] = isStuck ? 231 : 52; // red
  -        canvas[++index] = isStuck ? 76 : 152; // green
  -        canvas[++index] = isStuck ? 60 : 219; // blue
  +
  +    	var v = Math.sqrt(particles.stuck[i] / (stopping_fraction * particles.count));
  +    	var color = v > 0 ? colormap(v) : particle_color;
  +    	canvas[index] = color[0]; // red
  +        canvas[++index] = color[1]; // green
  +        canvas[++index] = color[2] ; // blue
           canvas[++index] = 255; // alpha 
   	}
   }
   ----
   
  -And lastly the start function triggered by button:
  -
  -
  -[source,javascript]
  -----
  -var parameters = JSON.parse(document.getElementById("parameters").value);
  -	var canvas = document.getElementById("canvas");
  -	canvas.width = parameters.width;
  -	canvas.height = parameters.height;
  -	var ctx = canvas.getContext('2d');
  -	
  -	var field = createField(parameters.width, parameters.height);
  -	var particleCount = Math.floor(parameters.width * parameters.height * parameters.particle_density);
  -	var particles = createParticles(field, particleCount);
  -
  -	var imageData = ctx.getImageData(0, 0, field.width, field.height);
  -	var clearCanvas = new Uint8Array(4*field.width * field.height)
  -	
  -	function step() {
  -		var j = particles.count;
  -		while (j--) {
  -			if (particles.stuck[j] != CLUSTER) {
  -				updateParticle(particles, field, j);
  -			}
  -		}	
  -		
  -		imageData.data.set(clearCanvas);
  -		render(field, imageData.data, particles);
  -		
  -		ctx.putImageData(imageData, 0, 0);
  -		
  -		var idle = 0;
  -		var i = particles.count;
  -		while (i--) 
  -			idle += particles.stuck[i];
  -
  -		if (idle < parameters.stopping_fraction * particles.count) {
  -			requestAnimationFrame(step);
  -		}
  -		else {
  -			imageData.data.set(clearCanvas);
  -			render(field, imageData.data, particles);
  -			ctx.putImageData(imageData, 0, 0);
  -		}
  -	}
  -
  -	requestAnimationFrame(step);
  -----
  -
  -
  -You can download finished visualisation link:https://github.com/xmichaelx/xmichaelx.github.io/tree/master/files/dla[here]. 
  -
  -
  -
  -== Sample image
  -
  -image:dla.png[Grosz,300] 
  -
  +The start function glues together functions above and triggers render function every frame.
  +
  +
  +You can download finished visualisation code link:https://github.com/xmichaelx/xmichaelx.github.io/tree/master/files/dla[here]. 
  +
  +
  +
  +== Sample images
  +
  +image:dla/23.png[DLA,300] 
  +image:dla/36.png[DLA,300] 
  +
  +image:dla/49.png[DLA,300] 
  +image:dla/62.png[DLA,300] 
  +
  +== Sample animation
  +
  +image:dla/dla.gif[DLA,300] 
  +
  +
  +
  +
  
positive.code: 2. When particle is next to a cluster it sticks to it.
  3. We start with a simple seed cluster consisting of one particle in the center of the visualisation.
  
  Model is dead simple. Let's see how we can implement it.
  
  == View
  
  
negative.code: function createParticles(field, count) {
  	var particles = {
  		count: count,
  		stuck: new Uint32Array(count),
  		x: new Uint16Array(count), 
  		y: new Uint16Array(count), 
  	};
  