add tests on matrix dimensions/content and a test function