lib: add methods for sorting