implements unique algorithm

Done!