First cut of block-extraction code