I think it would be good to add a check if that reduces teh line to length 0. Skip the line in that case.