add initial write functionality