using hash set instead of vector to track clusters