Finished general buffer writer, with bugs