converting lambda_to_block