test with duplicates
changed the indexing