Added initial write code.