Add generic search in matrix