create a matrix by words