https://yoninblog.com/ndarray-sort/290/