comment; refactor buffer and file structure