major updates to text processing, fixed line breaks