Rough wrapper around the write functions