simpler batching
fix buffer
flush after processing all i/o