print to optional file