Made modified index calculation less convoluted in tunnel