Tweaks to matrix to allow matrix inside matrix.