Added types for sorting order and criterion