added updateChunk and readChunk