indexOf now working except duplicates