Add fprintf and write docs.