correct matrix dimensons