change API for recursive blocks to allow for looping