creates the matrix in main instead of ClosestWords