updated matrix algebra