Added write method implementation for protocol