Beautiful matrix problem solved