Redo tabulate sorting to add as a parameter.