Hello, I'm wondering what is the most efficient way to implement an algorithm on a 2D-array: If the array item is larger than the average of its four neighbours plus 3 times the sqrt of that average, set it to the average. Thanks Wolfgang