calcIndex complete