-nan matrix error still present