Added chunking functionality