merge pull request for write buffering + unit test