search in 2D array reimpl