printf -> fprintf
merge