this block can be removed if in_count is initialized to min(BATCH_SIZE, count) above