Adds a function for factor level sorting.