add test for matrix