wrote ranged version of SetIndex for Mode