Added data write method.