Added block iterator so solution doesn't need to iterate through blocks.