write model