refactoring for indexPosition
Separate indexPosition for big indices
improve interval bisection for big sparse indices