Fixed lineCount for printing header at end