Store visited lists in Sets instead of ArrayLists