some values can be the same, so use indices