further work on matrix tests and tms