In that case, you can use a 'For Each ordered' to place all walls in order. The trick is to get the right expression. If you normalize all indexing to your grid, it's easier to conceptualize. Assuming the grid is zero based, and your grid is 32, your expression would be something like: (Wall.X / 32) * 1000 + (Wall.Y / 32). What this does is order by column then row, using a large number (1000) to ensure each column is going to index beyond the height of the grid. Now every wall is in order, you just keep track of if there is a wall, in the same column, before the current wall, and set it to red. Again, use local variables to store the 'previous' walls details.