Removing extra printing lines