Reorder index functions the right way.