fix print, little code cleanup