Add to correct index calculation