add max inflight
work on partitioning