documentation for sorting