fixing read to use size argument and chunk data