added getLineCount utility