Added write function pseudo-code style for now.