fixed index calculation to honor speed