Change index calculation algorithm