Help with a grid/array of objects

Hey Guys,

I’m trying to create a simple game similar to a bunch of games I’ve seen floating around. Here is an example:

http://bowlerhatgames.com/games/gridshock/

The part I’m having trouble with, is managing the array or matrix of objects. How would I go about testing the relation of a block, to the same blocks near it so I can remove those blocks, and let the rest fall back into the un-used spaces?

Thanks for the help in advance!