in reply to state preserving uniq
Why the lc? uniq as I know it is not case insensitive. You might want to note that behavior to any potential users.