log time instead of linear for case matching