I didn't know about gen_even_slices when I wrote this function. I'll fix it.