use sets for uniqueness (reduces computation time)