fixed line counting for files with windows line breaks