Modified to support blocks.