implement unique algorithm
added more tests, changed unique signature
fixed issues
Merge pull request #21 from gnzlbg/unique

implements unique algorithm