Rewrote unique/1 (better performance).