Add a sort function option.