performance improvement in search[12](); O(nm) -> O(m)