use pointer in place of array index

as well as do some change on the chunk format