Added write method