add add_block() function and helpers