Updated to a simpler set method to avoid duplicates