Generalizing code to affect neighbours