Good catch. Though, if we want to use your method for ensuring the order of the k-smallest indices, we would add that here.

Alternatively, since `argpartition` accepts several `k` arguments, we could avoid the order issue (at the cost of some speed) by calling:

    np.argpartition(a, range(k+1))

I'd rather just leave them unordered, however, and remove the else block entirely.