improved output buffer and history list