find word in a matrix in all directions, unoptimized