Use Set instead of uniquing array