Added matrix and test for it.