Smoothsort stuff