work on better matrix error reporting