Use gen_even_slices instead of homebaked code