Fix: better performing index calculation