implements unique algorithm

You should be testing the return value, too.