This is a script I wrote that can recognize groups of selected blocks. Select a few blocks and press submit to see the result.