fix table classifier

add a possibly slightly faster algorithm
as an alternative (not by default because it
accesses keys)