Working on write_chunks