Changed logic to use LinkedHashSet to obtain entries only once, slight decrease in performance, for greater accuracy :/