Add search in a 2d matrix