optimize one

search a 2d matrix