Block selection fix

Better fix for block selection in demo. 

If the index of is -1, loop through to see if it's an inner array.