get_block_groups function

Calculate block structure lengths