Added index calculation method