for example :
local variable : "PreviousValue"
Array : for each X element :
if Array.At(Array.CurX , 1) = PreviousValue :
then Array(Array.CurX , 1) = 0
Here, I check for every value on Y=1 if the previous value was the same, then I assign 0.
If i didn't answer to your problem, can you post a capx? it will help a lot in understanding