use set instead of list for more efficient retrieval (hash set with O(1) instead of linear array with O(n))