Change to use HashSet instead of ArrayList for better searching performance
change variable set to static