implemented chunksize option