Add binary sortedIndex
sortedIndex: Use mathmod for determining the index