changing logic (processing whole text)

line processing finally revealed to be flawed.