Removing unnecessary printout lines