use set instead of array for links