initial commit of wrapping buffering in chunk.c