Enhanced to take a block argument