Added to unility to find the connected blocks in a matrix