In the Sandpile model, try coloring each patch based on how big the avalanche would be if you dropped another grain on it. To do this, make use of the push-n and pop-n procedures so that you can get back to the distribution of grains before calculating the size of the avalanche.