runRightIndexFunction