So in a grid with 0's and 1's, for every 1 I want to find the closest cell containing a 0, storing that distance (in cells) in an additional grid. This only needs to be executed once to establish all the distances, so performance should not be an issue, however how could I find the distance to a cell with a certain value? Even if I checked all the cells, I would not know which is closest... Thanks!