Modify chunking logic