create writing functions