started working on writing to buffer instead of directly to a file.