wip
tweak batching code