matrix problem