Use Sets rather than Arrays.