Revised calcIndex.