simplified printout logic