Changed from cating to reassigning matrices.