Sort list before compare
Different flatten-unflatten approach using end-of-stream delimiters
Wrote some comments