Add support for manually specifying sort order