now works for non-numeric tables, too