Removed boolean from countUniqueLinks, altered algorithm slightly.