b) do you know the usual length of the slices? if so, can't you autogenerate/manually write switch to manually do the math? how would that perform?