Use floor division for index calculation