Search for word in a matrix