What is the effect of ``nkeep`` defaulting to ``-1``? I realize you didn't introduce that here, but I don't understand why that is. Maybe a better doc string about what this function is doing would help.