adding initial write support (still not in the public api)