'indices of values' function added