Now no longer outputs duplicates.