test updated with dimensions of matrices