made chunk_size customizable